import VueRouter from 'vue-router'
//路由按需加载
function routeView (fileName, pathName) {
  return () => import(`@/mobile/${fileName}/${pathName}`)
}
const routes = [
  { path: '/', component: routeView('login', 'mobileLogin'), name: '登录' },
  // {path:'/index',component:routeView('index','index'),name:'首页',children:[
  { path: '/index', component: routeView('index', 'main'), name: '首页', meta: { keepAlive: true } },
  { path: '/projectDetail', component: routeView('index', 'projectDetail'), name: '项目详情' },
  { path: '/changePassword', component: routeView('login', 'changePassword'), name: '忘记密码' },
  { path: '/contribution', component: routeView('index', 'contribution'), name: '贡献明细', meta: { keepAlive: true } },
  { path: '/registered', component: routeView('login', 'registered'), name: '注册' },
  // ]},
  // {path:'/userIndex',component:routeView('user','userInfo'),name:'个人中心',children:[
  { path: '/userIndex', component: routeView('user', 'userIndex'), name: '我的', meta: { keepAlive: true } },
  { path: '/modifypwd', component: routeView('user', 'modifypwd'), name: '修改密码' },
  { path: '/setting', component: routeView('user', 'setting'), name: '设置' },
  { path: '/projectList', component: routeView('user', 'projectList'), name: '我的项目', meta: { keepAlive: true } },
  { path: '/myTeam', component: routeView('user', 'myTeam'), name: '我的团队', meta: { keepAlive: true } },
  { path: '/promotion', component: routeView('user', 'promotion'), name: '如何晋升', meta: { keepAlive: true } },
  { path: '/helpCenter', component: routeView('user', 'helpCenter'), name: '帮助中心', meta: { keepAlive: true } },
  { path: '/contactCustomer', component: routeView('user', 'contactCustomer'), name: '联系客服', meta: { keepAlive: true } },
  { path: '/cashWithdrawal', component: routeView('user', 'cashWithdrawal'), name: '提现' },
  { path: '/topUp', component: routeView('user', 'topUp'), name: '充值' },
  { path: '/balance', component: routeView('user', 'balance'), name: '余额明细', meta: { keepAlive: true } },
  { path: '/membership', component: routeView('user', 'membership'), name: '会员等级' },
  { path: '/articleList', component: routeView('user', 'articleList'), name: '咨讯', meta: { keepAlive: true } },
  { path: '/newslist', component: routeView('user', 'newslist'), name: '咨讯详情' },
  { path: '/noticeList', component: routeView('user', 'noticeList'), name: '公告详情' },


  // ]}
]
export default new VueRouter({ routes })